Stunt Race FX - hacking notes ----------------------------- Matrixz (http://elazulspad.net/matrixz/) release 2 RAM { D2B : Racing Mode 00: Speed Trax 01: Stunt Trax 02: Battle Trax 03: Free Trax D4C : Speed Trax Mode 00: Normal >00: Bonus Trax D89: Vechile's engine sound type DA5 : Track Effect b0 : Centered Light b1 : Pre-Tunnel yellow shade in b2 : Post-Tunnel yellow shade out b3 : Inside Tunnel b4 : Lightning Effect b5 : Start Palette Shade effect Note: ([19FF] + [1A01]) must be < [1A03]. Must be reset first. b6 : Use 2nd Scenery graphics DE8 : Current Lap DEA : Current Lap E3D: Track ID E62-E66: Standard Timer E70-E71: Speed Trax Timer E78-E79: Speed Trax Timer Copy 10DA : Enable Demo mode (no music/sound change) 01: Yes 10DC : Enable Credits mode 01: Yes 10E2 : Sound/Music effect 10E3 : Stop Music/etc. 116C : Graphics to show for each vechile# in vechile select (16-bit) 0001: Coupe 001D: Rain 0063: 4WD 00C5: F-Type 0127: 2WD 18CB : Vechile# 18DB : Vechile Pointers in for each vechile grid (16-bit) 18E3 : Tile/Icon to show for each vechile in grid (16-bit) 19F8 : Palette Shade - ? 19FA : Palette Shade - ? 19FC : Palette Shade - ? 19FE : Palette Shade counter 1A00 : Palette Shade counter plus 1A02 : Palette Shade counter max 1A04 : Palette Shade - ? 1A05 : Palette Shade - ? 1A64 : Current Camera Mode 1A90 : Camera: X axis position relative to vechile (16-bit) 1A92 : Camera: Y axis position relative to vechile (16-bit) 1A94 : Camera: Z axis position relative to vechile (16-bit) 1A98 : Current Selectable Camera view 204E : Vechile Texture Set 2064 : Disable camera following vechile FD85 : Scenery - Current Palette Data (effects reflected here) FFA7 : Speed Trax: Grid Order (16-bit) 13460 : Palette Shade Effect Counter 13489 : Does stuff to palette 1348A : Also does stuff to palette 135F7 : Scenery - Current Palette Data 137F7 : Scenery - Palette Source Data (copy 2) 139F7 : Start of secondary palette? } E3D (Track ID) loads { E3D is loaded for various purposes at: 3DA0D: Horizon Picture 3EE28: Track Palette 3ED68: ?? 3ED7A: ?? 7FB13: Map Pic 4D18C: Music Track 3DE4E: ?? 3E86C: CMP with #$A 3EC58: Track Data 880EF: ?? } FXRAM { Memory that is not in the regular range, probably provided and used by the Super-FX chip. 70FC0B : Class clear status? } ROM { #[Hex] <- Actual ROM Offset ([Hex]) <- ROM Memory Pointer (3B723): Vechile: Data Pointer (16-bit) 853D: Coupé 8411: 4WD 81B9: F-Type 82E5: 2WD C208: Trailer (3D842): Speed Trax Timer - initial value (byte) (for all different combinations of tracks and wich vechile you use, im not sure about the order) (BC7DF): Vechile Select Order (BC81A): Vechile: Name Text / Stats Text 4 bytes for each vechile byte 0-1: Stats Text Ptr. byte 2-3: Name Text Ptr. #F8800: Easy Ride/Aqua Tunnel/King's Forest/Sea Breeze/Lake Side/Sky Ramp/Bonus Tracks Palette #F8A00: Harbor City Palette #F8C00: Night Owl Palette #F8E00: Unused Track Palette #F9000: Unused Track Palette 2 #F9200: Night Cruise Palette #F9400: Unused Track Palette 3 #F9600: Big Ravine Palette #F9800: Unused Track Palette 4 #F9A00: Unused Track Palette 5 #F9C00: White Land Palette #F9E00: Sunset Valley Palette #FA000: Stunt 1/Radio Control 2 Palette #FA200: Stunt 4/Radio Control 1 Palette #FA400: Stunt 3/Radio Control 3 Palette #FA600: Stunt 2/Radio Control 4 Palette #FA800: Battle Trax - Tracks Palette #FAA00 (1FAA00): Easy Ride Scenery Palette #FABB8 (1FABB8): Sea Breeze Scenery Palette #FAF28 (1FAF28): Lake Side Scenery Palette #1F4D7 (3F4D7): Track Data Pointers (58074): Easy Ride Track Data (58AB9): Aqua Tunnel Track Data (5990B): Sunset Valley Track Data (5A4FC): Night Owl Track Data (5B285): King's Forest Track Data (5BF92): Sea Breeze Track Data (5CADA): White Land Track Data (5D7F4): Night Cruise Track Data (D8000): Lake Side Track Data (D8CF9): Big Ravine Track Data (D9B5E): Sky Ramp Track Data (DAD25): Harbor City Track Data (DBD71): Stunt 1 Track Data (DCC71): Stunt 2 Track Data (15DB6F): Stunt 3 Track Data (DDF8C): Stunt 4 Track Data (15C000): Cotton Farm Track Data (15C6C3): Toxic Desert Track Data (15CD4C): Marine Pipe Track Data (15D444): Port Arena Track Data (5E509): Bonus 1 Track Data (5EBB7): Bonus 2 Track Data (5F245): Bonus 3 Track Data (15EEB7): Radio 1 Track Data (15F106): Radio 2 Track Data (15F313): Radio 3 Track Data (15F50A): Radio 4 Track Data (DF126): Test Run Track Data #ED99C (1DD99C): Title Music #EDEE0 (1DDEE0): Canyon Music #EE600 (1DE600): Unused Music 1 ! #EEC3C (1DEC3C): Upn' Down Music #EF044 (1DF044): King's Forest / Rock Field Music #EF39C (1DF39C): Bonus Track / Test Run Music #EF6E0 (1DF6E0): Radio Control Music #EF8B0 (1DF8B0): Results Screen Music ?#F0000 (1E8000): Easy Ride / Cotton Farm Music ?#F11BC (1E91BC): Lake Side / Marine Pipe Music ?#F3006 (1EB006): Night City Music #F4541 (1EC541): Unused Music 2 ! #F503D (1ED03D): Aquatic Music #F57E9 (1ED7E9): Sky Ramp / Ice Dance Music #F5E99 (1EDE99): Lake Side (alternate instruments, unused) #F6089 (1EE089): Course Select Music #F694D (1EE94D): Blue Lake Music #F73F5 (1EF3F5): Title Music (2) ?#F78ED (1EF8ED): White Land Music When the Song Init routine is called, A contains the 16-bit adress and Y contains the bank byte. In the Init routine, (1E8000), (1E91BC) and (1EB006) causes some exceptions where the data at those offsets is copied to memory. Perhaps the actual song data is somewhere else. (1EF8ED) points to the end of bank $1E where there are only $FF's. Still, $1EF8ED is the pointer loaded in Y and A registers when calling the Song Init routine, and it plays the White Land music. #1F52B: Track ID: Tile Set Pointers (178C0C): Easy Ride / White Land Tile Set (17AE94): Aqua Tunnel Tile Set (1FE86D): Aqua Tunnel Secondary Tile Set (1799A8): Sunset Valley / Big Ravine 1st Tile Set (17C178): King's Forest Tile Set (1FE1ED): Lake Side Tile Set (1DB6D4): Big Ravine 2nd Tile Set (1DAB84): Harbor City Tile Set (1DC3F4): Night Owl Tile Set (178ED0): Easy Ride / White Land Tile Map (1FED9D): Aqua Tunnel Tile Map (1FEA21): Aqua Tunnel Secondary Tile Map (179DE4): Sunset Valley Tile Map (17A1E4): Sunset Valley Secondary Tile Map (17C4BC): King's Forest Tile Map (17B2A8): Sea Breeze Tile Map (1FE3D5): Lake Side Tile Map (1DB2B0): Big Ravine Tile Map (1FF651): Big Ravine 2nd Tile Map (1DAECC): Harbor City Tile Map (1DC7DC): Night Owl Tile Set (1B86B4): Sample Set #1 (1B9C56): Sample Set #2 (1BA746): Sample Set #3 (1BB95C): Sample Set #4 #14092: Track ID for White Land fog effect #14097: Track ID for King's Forest fog effect #263C6: Track ID for Harbor City palette animation #4ADAF: Graphics pointer (geometry) for Blue power gem } ASM { (3F090): Song Init Code? (9E7D2): King's Forest - Palette Shade Init } Track Data { Size Data 2 #061A 1 Truck start position on goal line b0: Start to the left? 1 ? (#00) 1 #14 1 Weather effect byte b1-b0: Weather effect 0: None 1: Rain 2: Snow 3: Hard Rain 1 ? (#00) 1 #08 1 ? (#00) 1 #08 1 ? (#00) 1 #14 1 Weather effect byte 2 b1-b0: Weather effect 0: None 1: Rain 2: Snow 3: Hard Rain 2 #010E Track component data (what objects are placed where) starts some place after this. I dont know what determines where, here are those i figured out: Easy Ride: (58128) (58074 + B4) Aqua Tunnel: (58B72) (58AB9 + B9) White Land: (5CB91) (5CADA + B7) Lake Side: (D80B9) (D8000 + B9) } Track Component Data { Each component is $16 bytes for commands $02 and $0C, and two bytes for command $08. Objects seems to be divided in 3 different categories, ill refer to them by characters: R : Road objects, making up the racing road, has substance data used in collision-detection. G : General objects, various 3D objects on the track. Has code adress for object movement and/or special events. T : Textures, has no effect on the gameplay mechanics. 00: Command ($02 for G objects like Blue Power Gem / R objects, $0C for R objects / T textures. Not sure which is used when, but they work differently.) [If command is $08, one byte follows, telling which direction the following objects should be facing, and data starts back on another Component.] 01: (bitfeed?) 02: X position 03: (bitfeed?) 04: Y position (height above/under ground, can be negative) 05: (bitfeed?) 06: Z position 07-08: 16-bit Graphics Data Adress ($A040 causes exception, no object is shown) 09-0A: 16-bit Road Substance Adress (on R road object, else $0000) 0B-0D: 24-bit Object Code Adress (must be $8CD2D on R road object) 0E-13: One of these can trigger object effect upon object becoming visible. 14-15: If AND with $0200, ignore object effect? Does some odd exeption. (need to be $2200 for R objects?) } Track Componenet Adresses of Easy Ride { Play around :) #28128 (58128): Road: Goal #2813E (5813E): Object: Goal Road walls #28154 (58154): Goal Audience Left #2816A (5816A): Goal Audience Right #28180 (58180): Goal Gate #28196 (58196): Road: 2nd #281AC (581AC): Crossway 2nd #281C2 (581C2): Road: 3rd (crossway) #281D8 (581D8): Gas Station #281EE (581EE): $08 command with $C0 data } Graphics Data Adresses { T: Texture R: Road 3D object G: General 3D Object A040: Nothing ?? A0CC:T Snowman A104:T Tree A9FC:R Crossway (blocker) AAA4:R Smal side-walls AAC0:R Smal side-walls (short) AB30:R Side-walls - Smal left-turn (White Land) AB68:R Audience L AB84:R Audience R ABBC:R Smal side-walls (2) ABD8:G Seagull AC2C:G House 1 (Easy Ride) AC48:G House 2 (Easy Ride) AD7C:G Air-balloon AD98:G Gas Station AF04:G Dolphin AF20:G Dolphin (2) AF90:T Mario face texture AFAC:T Mario face texture (2) AFC8:T Starfox face texture B1DC:G Walls (Aqua Tunnel) B78C:R Goal Gate B7A8:G Blue Power Gem B7C4:G Red Power Gem BE8C:R Smal left-turn (White Land) BEE0:R Straightforward - Snow to no snow (White Land) BEFC:R Straightforward (long?) BF18:R Straightforward C228:R Straightforward (With snow/grass) (White Land) C260:R Up-Right turn with grass/snow C570:R Straightforward (smal bump) D798:R Straightforward (goal-line?) D7EC:R Road to 2nd floor (White Land) E1E0:R Big Bump (White Land) E544:G Truck (Easy Ride) EDB0:R Long Up-Right turn (right piece of road) F0C0:R Long Up-Right turn (left piece of road) F0DC:R Long Up-Right turn (upper piece of road) FA98:R Up-Right turn Big Walls Left (2) (White Land) FAB4:R Straightforward Big Walls Left end (White Land) FAD0:R Up-Right turn Big Walls Left (White Land) FAEC:R Straightforward Big Walls Left (White Land) } Road Substance Adresses { C74C: Smal left-turn (White Land) C9D0: Big Bump (White Land) CA08: Straightforward (With snow/grass) (White Land) CA40: Up-Right turn. CE68: Straightforward (smal bump) CEF4: Straightforward CF10: Straightforward (long?) D098: Straightforward (goal-line?) D108: Road to 2nd floor (White Land) E7AC: Straightforward - Snow to no snow (White Land) E7C8: Long Up-Right turn (upper piece of road) F4E8: Long Up-Right turn (right piece of road) F7A4: Long Up-Right turn (left piece of road) FC90: Straightforward Big Walls Left end (White Land) FCAC: Up-Right turn Big Walls Left (White Land) FCC8: Straightforward Big Walls Left (White Land) FE6C: Up-Right turn Big Walls Left (2) (White Land) } Object Code Adresses { 098B3B: Tree (Easy Ride) 099048: Rolling Snowball Event (White Land) 09A06A: Snowman (White Land) 09A4E7: Under-road / snow-off effect Off (White Land) 09A458: Under-road / snow-off effect On (White Land) 09ABF3: Nothing? 09AC4F: Nothing? 09AD5E: Blue Power Gem 09AEBF: Red Power Gem 09C5DA: Nothing? 09C613: Air-balloon movement 09C90C: Tower Obj (Easy Ride) 09CAB1: Seagull 09CEA8: Dolphin (1) 09CFE3: Dolphin (2) 09E3E4: Truck (Easy Ride) 09E4D6: Crossway (blocker) 09EBE5: Under-bridge effect }